    $(function(){
        berserker.addView({
            name:'ztsj',
            tpl:'tpl_ztsj',
            dataURL:'/api/ztsj.json',
            beforeRender:function(host){
                var chartEvent={};
                chartEvent['ztsj-chart2']={
                    plotOptions: {
                        pie: {
                            allowPointSelect: true,cursor: 'pointer',
                            showInLegend:true,
                            dataLabels: {
                                enabled: true,
                                color: '#000000',
                                connectorColor: '#000000',
                                formatter: function() {
                                    return '<b>'+ this.point.name +'</b>: '+ this.percentage +' %';
                                }
                            }
                        }
                    }
                }
                host.data('chartEvent',chartEvent);
            },
            done:function(host,data){
                //绑定tab view
                //$(".tabview > ul",host).tabs(".tabview > .tabContent");
                $(".tabview > ul li",host).click(function(){
                    var tab = $('.tabContent:eq('+this.getAttribute('data-role')+')',host);
                     if(tab){
                        var cloud =  $('.tagCloud',tab);
                        if(cloud){
                            setTimeout(function(){
                                if(cloud.attr('data-key')){
                                    cloud.jQCloud(data['tagCloud'][cloud.attr('data-key')]);
                                    cloud.click(function(evt){
                                        var target = evt.target;
                                        if(target && target.tagName == 'SPAN'){
                                            showRight(this.getAttribute('data-url'),{key:target.innerHTML});
                                        }
                                    })
                                    cloud.attr('data-key',null)
                                }
                            },200)
                        }
                    }
                })
                //跑马灯
                $(".slidetabs-nav").tabs(".slidetabs > div", {
                    effect: 'fade',
                    fadeOutSpeed: "fast",
                    autoplay:true,
                    interval:500,
                    rotate: true
                }).slideshow();
            }
        })
    })
